package org.example.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GetwayConfig {

    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder builder){
        return builder.routes().route("server_v3",r -> r.path("/user/**")
                .filters(f -> f.addResponseHeader("X-TestHeader", "foobar")).uri("http://localhost:8083")).build();
    }
}
